package com.xzw.mapper;

import com.xzw.pojo.Clazz;
import com.xzw.pojo.ClazzQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClazzMapper {
    /**
     * 分页查询班级
     */
    List<Clazz> list(ClazzQueryParam clazzQueryParam);
    /**
     * 删除班级
     */
    @Delete("delete from clazz where id = #{id}")
    void deleteById(Integer id);
    /**
     * 新增班级
     */
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into clazz(name, room, begin_date, end_date, master_id, subject, create_time, update_time) " +
            "values(#{name}, #{room}, #{beginDate}, #{endDate}, #{masterId}, #{subject}, #{createTime}, #{updateTime})")
    void insert(Clazz clazz);
    /**
     * 根据ID查询班级信息 -- 查询回显功能
     */
    Clazz getById(Integer id);

    /**
     * 修改班级信息
     */
    void updateById(Clazz clazz);
}
